package edu.hunau.cxb.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hb
 * @create 2020-04-15 10:23
 */
@RestController
@ConfigurationProperties(prefix = "student")
public class StudentController {
  //为属性提供setter方法
    private String name;
    private Integer age;

    @GetMapping("/init")
    public  String execute(){
      return "name="+name+" : age="+age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(Integer age) {
        this.age = age;
    }
}
